package com.axjy.t152ssm.service.impl;

import com.axjy.t152ssm.dao.UserMapper;
import com.axjy.t152ssm.dto.UserDto;
import com.axjy.t152ssm.service.UserService;
import com.axjy.t152ssm.vo.Pager;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import javax.annotation.Resource;

/**
 * Created by asus on 2018/1/15.
 */
@Service("userService")
@Transactional
public class UserServiceImpl implements UserService{

    @Resource
    private UserMapper userMapper;

    @Override
    @Transactional(readOnly=true)
    public Pager searchPager(Integer offset, Integer limit, UserDto dto) {
        Pager pager=new Pager();
        pager.setRows(userMapper.findRows(offset,limit,dto));
        pager.setTotal(userMapper.findTotal(dto));
        return pager;
    }
}
